﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
namespace GenerateDiagram
{
    public abstract class DataConnection
    {
        public string ConnectionString { get; set; }
        public int ConnectionTimeout { get; set; }
        public string Database { get; set; }
        private static SqlDataConnection instance = null;
        public static DataConnection Instance
        {
            get
            {
                if (instance == null) instance = new SqlDataConnection();
                return instance;
            }
        }

        public abstract DbConnection CreateConnection();
        /// <summary>
        /// 
        /// </summary>
        /// <param name="commandText">Command text to execute </param>
        /// <param name="databaseName">Database to execute</param>
        /// <returns></returns>
        public abstract DataTable ExecuteReader(string commandText, string databaseName);

    }
}
